package diona.dao;

import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;

/**
* User: anton
* Date: 20.03.11 13:26
*/
public enum ShareType
{
    IMAGE(0), FILE_PATH(1);

    private static final Map<Integer, ShareType> byCode = new HashMap<Integer, ShareType>();

    static {
        for (ShareType shareType : ShareType.values()) {
            byCode.put(shareType.code, shareType);
        }
    }

    public static ShareType getByCode(int code)
    {
        return byCode.get(code);
    }

    int code;

    ShareType(int code)
    {
        this.code = code;
    }
}
